//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2022 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

import Foundation
import SotoCore

extension WorkLink {
    // MARK: Enums

    public enum AuthorizationProviderType: String, CustomStringConvertible, Codable, _SotoSendable {
        case saml = "SAML"
        public var description: String { return self.rawValue }
    }

    public enum DeviceStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case active = "ACTIVE"
        case signedOut = "SIGNED_OUT"
        public var description: String { return self.rawValue }
    }

    public enum DomainStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case active = "ACTIVE"
        case associating = "ASSOCIATING"
        case disassociated = "DISASSOCIATED"
        case disassociating = "DISASSOCIATING"
        case failedToAssociate = "FAILED_TO_ASSOCIATE"
        case failedToDisassociate = "FAILED_TO_DISASSOCIATE"
        case inactive = "INACTIVE"
        case pendingValidation = "PENDING_VALIDATION"
        public var description: String { return self.rawValue }
    }

    public enum FleetStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case active = "ACTIVE"
        case creating = "CREATING"
        case deleted = "DELETED"
        case deleting = "DELETING"
        case failedToCreate = "FAILED_TO_CREATE"
        case failedToDelete = "FAILED_TO_DELETE"
        public var description: String { return self.rawValue }
    }

    public enum IdentityProviderType: String, CustomStringConvertible, Codable, _SotoSendable {
        case saml = "SAML"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct AssociateDomainRequest: AWSEncodableShape {
        /// The ARN of an issued ACM certificate that is valid for the domain being associated.
        public let acmCertificateArn: String
        /// The name to display.
        public let displayName: String?
        /// The fully qualified domain name (FQDN).
        public let domainName: String
        /// The Amazon Resource Name (ARN) of the fleet.
        public let fleetArn: String

        public init(acmCertificateArn: String, displayName: String? = nil, domainName: String, fleetArn: String) {
            self.acmCertificateArn = acmCertificateArn
            self.displayName = displayName
            self.domainName = domainName
            self.fleetArn = fleetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.acmCertificateArn, name: "acmCertificateArn", parent: name, pattern: "^arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]+:[\\w+=,.@-]+(/[\\w+=/,.@-]+)*$")
            try self.validate(self.displayName, name: "displayName", parent: name, max: 100)
            try self.validate(self.domainName, name: "domainName", parent: name, max: 253)
            try self.validate(self.domainName, name: "domainName", parent: name, min: 1)
            try self.validate(self.domainName, name: "domainName", parent: name, pattern: "^[a-zA-Z0-9]?((?!-)([A-Za-z0-9-]*[A-Za-z0-9])\\.)+[a-zA-Z0-9]+$")
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case acmCertificateArn = "AcmCertificateArn"
            case displayName = "DisplayName"
            case domainName = "DomainName"
            case fleetArn = "FleetArn"
        }
    }

    public struct AssociateDomainResponse: AWSDecodableShape {
        public init() {}
    }

    public struct AssociateWebsiteAuthorizationProviderRequest: AWSEncodableShape {
        /// The authorization provider type.
        public let authorizationProviderType: AuthorizationProviderType
        /// The domain name of the authorization provider. This applies only to SAML-based authorization providers.
        public let domainName: String?
        /// The ARN of the fleet.
        public let fleetArn: String

        public init(authorizationProviderType: AuthorizationProviderType, domainName: String? = nil, fleetArn: String) {
            self.authorizationProviderType = authorizationProviderType
            self.domainName = domainName
            self.fleetArn = fleetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.domainName, name: "domainName", parent: name, max: 253)
            try self.validate(self.domainName, name: "domainName", parent: name, min: 1)
            try self.validate(self.domainName, name: "domainName", parent: name, pattern: "^[a-zA-Z0-9]?((?!-)([A-Za-z0-9-]*[A-Za-z0-9])\\.)+[a-zA-Z0-9]+$")
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case authorizationProviderType = "AuthorizationProviderType"
            case domainName = "DomainName"
            case fleetArn = "FleetArn"
        }
    }

    public struct AssociateWebsiteAuthorizationProviderResponse: AWSDecodableShape {
        /// A unique identifier for the authorization provider.
        public let authorizationProviderId: String?

        public init(authorizationProviderId: String? = nil) {
            self.authorizationProviderId = authorizationProviderId
        }

        private enum CodingKeys: String, CodingKey {
            case authorizationProviderId = "AuthorizationProviderId"
        }
    }

    public struct AssociateWebsiteCertificateAuthorityRequest: AWSEncodableShape {
        /// The root certificate of the CA.
        public let certificate: String
        /// The certificate name to display.
        public let displayName: String?
        /// The ARN of the fleet.
        public let fleetArn: String

        public init(certificate: String, displayName: String? = nil, fleetArn: String) {
            self.certificate = certificate
            self.displayName = displayName
            self.fleetArn = fleetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.certificate, name: "certificate", parent: name, max: 8192)
            try self.validate(self.certificate, name: "certificate", parent: name, min: 1)
            try self.validate(self.certificate, name: "certificate", parent: name, pattern: "^-{5}BEGIN CERTIFICATE-{5}\\u000D?\\u000A([A-Za-z0-9/+]{64}\\u000D?\\u000A)*[A-Za-z0-9/+]{1,64}={0,2}\\u000D?\\u000A-{5}END CERTIFICATE-{5}(\\u000D?\\u000A)?$")
            try self.validate(self.displayName, name: "displayName", parent: name, max: 100)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case certificate = "Certificate"
            case displayName = "DisplayName"
            case fleetArn = "FleetArn"
        }
    }

    public struct AssociateWebsiteCertificateAuthorityResponse: AWSDecodableShape {
        /// A unique identifier for the CA.
        public let websiteCaId: String?

        public init(websiteCaId: String? = nil) {
            self.websiteCaId = websiteCaId
        }

        private enum CodingKeys: String, CodingKey {
            case websiteCaId = "WebsiteCaId"
        }
    }

    public struct CreateFleetRequest: AWSEncodableShape {
        /// The fleet name to display.
        public let displayName: String?
        /// A unique name for the fleet.
        public let fleetName: String
        /// The option to optimize for better performance by routing traffic through the closest AWS Region to users, which may be outside of your home Region.
        public let optimizeForEndUserLocation: Bool?
        ///  The tags to add to the resource. A tag is a key-value pair.
        public let tags: [String: String]?

        public init(displayName: String? = nil, fleetName: String, optimizeForEndUserLocation: Bool? = nil, tags: [String: String]? = nil) {
            self.displayName = displayName
            self.fleetName = fleetName
            self.optimizeForEndUserLocation = optimizeForEndUserLocation
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.displayName, name: "displayName", parent: name, max: 100)
            try self.validate(self.fleetName, name: "fleetName", parent: name, max: 48)
            try self.validate(self.fleetName, name: "fleetName", parent: name, min: 1)
            try self.validate(self.fleetName, name: "fleetName", parent: name, pattern: "^[a-z0-9](?:[a-z0-9\\-]{0,46}[a-z0-9])?$")
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case displayName = "DisplayName"
            case fleetName = "FleetName"
            case optimizeForEndUserLocation = "OptimizeForEndUserLocation"
            case tags = "Tags"
        }
    }

    public struct CreateFleetResponse: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the fleet.
        public let fleetArn: String?

        public init(fleetArn: String? = nil) {
            self.fleetArn = fleetArn
        }

        private enum CodingKeys: String, CodingKey {
            case fleetArn = "FleetArn"
        }
    }

    public struct DeleteFleetRequest: AWSEncodableShape {
        /// The ARN of the fleet.
        public let fleetArn: String

        public init(fleetArn: String) {
            self.fleetArn = fleetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case fleetArn = "FleetArn"
        }
    }

    public struct DeleteFleetResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DescribeAuditStreamConfigurationRequest: AWSEncodableShape {
        /// The ARN of the fleet.
        public let fleetArn: String

        public init(fleetArn: String) {
            self.fleetArn = fleetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case fleetArn = "FleetArn"
        }
    }

    public struct DescribeAuditStreamConfigurationResponse: AWSDecodableShape {
        /// The ARN of the Amazon Kinesis data stream that will receive the audit events.
        public let auditStreamArn: String?

        public init(auditStreamArn: String? = nil) {
            self.auditStreamArn = auditStreamArn
        }

        private enum CodingKeys: String, CodingKey {
            case auditStreamArn = "AuditStreamArn"
        }
    }

    public struct DescribeCompanyNetworkConfigurationRequest: AWSEncodableShape {
        /// The ARN of the fleet.
        public let fleetArn: String

        public init(fleetArn: String) {
            self.fleetArn = fleetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case fleetArn = "FleetArn"
        }
    }

    public struct DescribeCompanyNetworkConfigurationResponse: AWSDecodableShape {
        /// The security groups associated with access to the provided subnets.
        public let securityGroupIds: [String]?
        /// The subnets used for X-ENI connections from Amazon WorkLink rendering containers.
        public let subnetIds: [String]?
        /// The VPC with connectivity to associated websites.
        public let vpcId: String?

        public init(securityGroupIds: [String]? = nil, subnetIds: [String]? = nil, vpcId: String? = nil) {
            self.securityGroupIds = securityGroupIds
            self.subnetIds = subnetIds
            self.vpcId = vpcId
        }

        private enum CodingKeys: String, CodingKey {
            case securityGroupIds = "SecurityGroupIds"
            case subnetIds = "SubnetIds"
            case vpcId = "VpcId"
        }
    }

    public struct DescribeDevicePolicyConfigurationRequest: AWSEncodableShape {
        /// The ARN of the fleet.
        public let fleetArn: String

        public init(fleetArn: String) {
            self.fleetArn = fleetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case fleetArn = "FleetArn"
        }
    }

    public struct DescribeDevicePolicyConfigurationResponse: AWSDecodableShape {
        /// The certificate chain, including intermediate certificates and the root certificate authority certificate used to issue device certificates.
        public let deviceCaCertificate: String?

        public init(deviceCaCertificate: String? = nil) {
            self.deviceCaCertificate = deviceCaCertificate
        }

        private enum CodingKeys: String, CodingKey {
            case deviceCaCertificate = "DeviceCaCertificate"
        }
    }

    public struct DescribeDeviceRequest: AWSEncodableShape {
        /// A unique identifier for a registered user's device.
        public let deviceId: String
        /// The ARN of the fleet.
        public let fleetArn: String

        public init(deviceId: String, fleetArn: String) {
            self.deviceId = deviceId
            self.fleetArn = fleetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.deviceId, name: "deviceId", parent: name, max: 256)
            try self.validate(self.deviceId, name: "deviceId", parent: name, min: 1)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case deviceId = "DeviceId"
            case fleetArn = "FleetArn"
        }
    }

    public struct DescribeDeviceResponse: AWSDecodableShape {
        /// The date that the device first signed in to Amazon WorkLink.
        public let firstAccessedTime: Date?
        /// The date that the device last accessed Amazon WorkLink.
        public let lastAccessedTime: Date?
        /// The manufacturer of the device.
        public let manufacturer: String?
        /// The model of the device.
        public let model: String?
        /// The operating system of the device.
        public let operatingSystem: String?
        /// The operating system version of the device.
        public let operatingSystemVersion: String?
        /// The operating system patch level of the device.
        public let patchLevel: String?
        /// The current state of the device.
        public let status: DeviceStatus?
        /// The user name associated with the device.
        public let username: String?

        public init(firstAccessedTime: Date? = nil, lastAccessedTime: Date? = nil, manufacturer: String? = nil, model: String? = nil, operatingSystem: String? = nil, operatingSystemVersion: String? = nil, patchLevel: String? = nil, status: DeviceStatus? = nil, username: String? = nil) {
            self.firstAccessedTime = firstAccessedTime
            self.lastAccessedTime = lastAccessedTime
            self.manufacturer = manufacturer
            self.model = model
            self.operatingSystem = operatingSystem
            self.operatingSystemVersion = operatingSystemVersion
            self.patchLevel = patchLevel
            self.status = status
            self.username = username
        }

        private enum CodingKeys: String, CodingKey {
            case firstAccessedTime = "FirstAccessedTime"
            case lastAccessedTime = "LastAccessedTime"
            case manufacturer = "Manufacturer"
            case model = "Model"
            case operatingSystem = "OperatingSystem"
            case operatingSystemVersion = "OperatingSystemVersion"
            case patchLevel = "PatchLevel"
            case status = "Status"
            case username = "Username"
        }
    }

    public struct DescribeDomainRequest: AWSEncodableShape {
        /// The name of the domain.
        public let domainName: String
        /// The ARN of the fleet.
        public let fleetArn: String

        public init(domainName: String, fleetArn: String) {
            self.domainName = domainName
            self.fleetArn = fleetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.domainName, name: "domainName", parent: name, max: 253)
            try self.validate(self.domainName, name: "domainName", parent: name, min: 1)
            try self.validate(self.domainName, name: "domainName", parent: name, pattern: "^[a-zA-Z0-9]?((?!-)([A-Za-z0-9-]*[A-Za-z0-9])\\.)+[a-zA-Z0-9]+$")
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case domainName = "DomainName"
            case fleetArn = "FleetArn"
        }
    }

    public struct DescribeDomainResponse: AWSDecodableShape {
        /// The ARN of an issued ACM certificate that is valid for the domain being associated.
        public let acmCertificateArn: String?
        /// The time that the domain was added.
        public let createdTime: Date?
        /// The name to display.
        public let displayName: String?
        /// The name of the domain.
        public let domainName: String?
        /// The current state for the domain.
        public let domainStatus: DomainStatus?

        public init(acmCertificateArn: String? = nil, createdTime: Date? = nil, displayName: String? = nil, domainName: String? = nil, domainStatus: DomainStatus? = nil) {
            self.acmCertificateArn = acmCertificateArn
            self.createdTime = createdTime
            self.displayName = displayName
            self.domainName = domainName
            self.domainStatus = domainStatus
        }

        private enum CodingKeys: String, CodingKey {
            case acmCertificateArn = "AcmCertificateArn"
            case createdTime = "CreatedTime"
            case displayName = "DisplayName"
            case domainName = "DomainName"
            case domainStatus = "DomainStatus"
        }
    }

    public struct DescribeFleetMetadataRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the fleet.
        public let fleetArn: String

        public init(fleetArn: String) {
            self.fleetArn = fleetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case fleetArn = "FleetArn"
        }
    }

    public struct DescribeFleetMetadataResponse: AWSDecodableShape {
        /// The identifier used by users to sign in to the Amazon WorkLink app.
        public let companyCode: String?
        /// The time that the fleet was created.
        public let createdTime: Date?
        /// The name to display.
        public let displayName: String?
        /// The name of the fleet.
        public let fleetName: String?
        /// The current state of the fleet.
        public let fleetStatus: FleetStatus?
        /// The time that the fleet was last updated.
        public let lastUpdatedTime: Date?
        /// The option to optimize for better performance by routing traffic through the closest AWS Region to users, which may be outside of your home Region.
        public let optimizeForEndUserLocation: Bool?
        /// The tags attached to the resource. A tag is a key-value pair.
        public let tags: [String: String]?

        public init(companyCode: String? = nil, createdTime: Date? = nil, displayName: String? = nil, fleetName: String? = nil, fleetStatus: FleetStatus? = nil, lastUpdatedTime: Date? = nil, optimizeForEndUserLocation: Bool? = nil, tags: [String: String]? = nil) {
            self.companyCode = companyCode
            self.createdTime = createdTime
            self.displayName = displayName
            self.fleetName = fleetName
            self.fleetStatus = fleetStatus
            self.lastUpdatedTime = lastUpdatedTime
            self.optimizeForEndUserLocation = optimizeForEndUserLocation
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case companyCode = "CompanyCode"
            case createdTime = "CreatedTime"
            case displayName = "DisplayName"
            case fleetName = "FleetName"
            case fleetStatus = "FleetStatus"
            case lastUpdatedTime = "LastUpdatedTime"
            case optimizeForEndUserLocation = "OptimizeForEndUserLocation"
            case tags = "Tags"
        }
    }

    public struct DescribeIdentityProviderConfigurationRequest: AWSEncodableShape {
        /// The ARN of the fleet.
        public let fleetArn: String

        public init(fleetArn: String) {
            self.fleetArn = fleetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case fleetArn = "FleetArn"
        }
    }

    public struct DescribeIdentityProviderConfigurationResponse: AWSDecodableShape {
        /// The SAML metadata document provided by the user’s identity provider.
        public let identityProviderSamlMetadata: String?
        /// The type of identity provider.
        public let identityProviderType: IdentityProviderType?
        /// The SAML metadata document uploaded to the user’s identity provider.
        public let serviceProviderSamlMetadata: String?

        public init(identityProviderSamlMetadata: String? = nil, identityProviderType: IdentityProviderType? = nil, serviceProviderSamlMetadata: String? = nil) {
            self.identityProviderSamlMetadata = identityProviderSamlMetadata
            self.identityProviderType = identityProviderType
            self.serviceProviderSamlMetadata = serviceProviderSamlMetadata
        }

        private enum CodingKeys: String, CodingKey {
            case identityProviderSamlMetadata = "IdentityProviderSamlMetadata"
            case identityProviderType = "IdentityProviderType"
            case serviceProviderSamlMetadata = "ServiceProviderSamlMetadata"
        }
    }

    public struct DescribeWebsiteCertificateAuthorityRequest: AWSEncodableShape {
        /// The ARN of the fleet.
        public let fleetArn: String
        /// A unique identifier for the certificate authority.
        public let websiteCaId: String

        public init(fleetArn: String, websiteCaId: String) {
            self.fleetArn = fleetArn
            self.websiteCaId = websiteCaId
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
            try self.validate(self.websiteCaId, name: "websiteCaId", parent: name, max: 256)
            try self.validate(self.websiteCaId, name: "websiteCaId", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case fleetArn = "FleetArn"
            case websiteCaId = "WebsiteCaId"
        }
    }

    public struct DescribeWebsiteCertificateAuthorityResponse: AWSDecodableShape {
        /// The root certificate of the certificate authority.
        public let certificate: String?
        /// The time that the certificate authority was added.
        public let createdTime: Date?
        /// The certificate name to display.
        public let displayName: String?

        public init(certificate: String? = nil, createdTime: Date? = nil, displayName: String? = nil) {
            self.certificate = certificate
            self.createdTime = createdTime
            self.displayName = displayName
        }

        private enum CodingKeys: String, CodingKey {
            case certificate = "Certificate"
            case createdTime = "CreatedTime"
            case displayName = "DisplayName"
        }
    }

    public struct DeviceSummary: AWSDecodableShape {
        /// The ID of the device.
        public let deviceId: String?
        /// The status of the device.
        public let deviceStatus: DeviceStatus?

        public init(deviceId: String? = nil, deviceStatus: DeviceStatus? = nil) {
            self.deviceId = deviceId
            self.deviceStatus = deviceStatus
        }

        private enum CodingKeys: String, CodingKey {
            case deviceId = "DeviceId"
            case deviceStatus = "DeviceStatus"
        }
    }

    public struct DisassociateDomainRequest: AWSEncodableShape {
        /// The name of the domain.
        public let domainName: String
        /// The ARN of the fleet.
        public let fleetArn: String

        public init(domainName: String, fleetArn: String) {
            self.domainName = domainName
            self.fleetArn = fleetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.domainName, name: "domainName", parent: name, max: 253)
            try self.validate(self.domainName, name: "domainName", parent: name, min: 1)
            try self.validate(self.domainName, name: "domainName", parent: name, pattern: "^[a-zA-Z0-9]?((?!-)([A-Za-z0-9-]*[A-Za-z0-9])\\.)+[a-zA-Z0-9]+$")
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case domainName = "DomainName"
            case fleetArn = "FleetArn"
        }
    }

    public struct DisassociateDomainResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DisassociateWebsiteAuthorizationProviderRequest: AWSEncodableShape {
        /// A unique identifier for the authorization provider.
        public let authorizationProviderId: String
        /// The ARN of the fleet.
        public let fleetArn: String

        public init(authorizationProviderId: String, fleetArn: String) {
            self.authorizationProviderId = authorizationProviderId
            self.fleetArn = fleetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.authorizationProviderId, name: "authorizationProviderId", parent: name, max: 256)
            try self.validate(self.authorizationProviderId, name: "authorizationProviderId", parent: name, min: 1)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case authorizationProviderId = "AuthorizationProviderId"
            case fleetArn = "FleetArn"
        }
    }

    public struct DisassociateWebsiteAuthorizationProviderResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DisassociateWebsiteCertificateAuthorityRequest: AWSEncodableShape {
        /// The ARN of the fleet.
        public let fleetArn: String
        /// A unique identifier for the CA.
        public let websiteCaId: String

        public init(fleetArn: String, websiteCaId: String) {
            self.fleetArn = fleetArn
            self.websiteCaId = websiteCaId
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
            try self.validate(self.websiteCaId, name: "websiteCaId", parent: name, max: 256)
            try self.validate(self.websiteCaId, name: "websiteCaId", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case fleetArn = "FleetArn"
            case websiteCaId = "WebsiteCaId"
        }
    }

    public struct DisassociateWebsiteCertificateAuthorityResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DomainSummary: AWSDecodableShape {
        /// The time that the domain was created.
        public let createdTime: Date
        /// The name to display.
        public let displayName: String?
        /// The name of the domain.
        public let domainName: String
        /// The status of the domain.
        public let domainStatus: DomainStatus

        public init(createdTime: Date, displayName: String? = nil, domainName: String, domainStatus: DomainStatus) {
            self.createdTime = createdTime
            self.displayName = displayName
            self.domainName = domainName
            self.domainStatus = domainStatus
        }

        private enum CodingKeys: String, CodingKey {
            case createdTime = "CreatedTime"
            case displayName = "DisplayName"
            case domainName = "DomainName"
            case domainStatus = "DomainStatus"
        }
    }

    public struct FleetSummary: AWSDecodableShape {
        /// The identifier used by users to sign into the Amazon WorkLink app.
        public let companyCode: String?
        /// The time when the fleet was created.
        public let createdTime: Date?
        /// The name of the fleet to display.
        public let displayName: String?
        /// The Amazon Resource Name (ARN) of the fleet.
        public let fleetArn: String?
        /// The name of the fleet.
        public let fleetName: String?
        /// The status of the fleet.
        public let fleetStatus: FleetStatus?
        /// The time when the fleet was last updated.
        public let lastUpdatedTime: Date?
        /// The tags attached to the resource. A tag is a key-value pair.
        public let tags: [String: String]?

        public init(companyCode: String? = nil, createdTime: Date? = nil, displayName: String? = nil, fleetArn: String? = nil, fleetName: String? = nil, fleetStatus: FleetStatus? = nil, lastUpdatedTime: Date? = nil, tags: [String: String]? = nil) {
            self.companyCode = companyCode
            self.createdTime = createdTime
            self.displayName = displayName
            self.fleetArn = fleetArn
            self.fleetName = fleetName
            self.fleetStatus = fleetStatus
            self.lastUpdatedTime = lastUpdatedTime
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case companyCode = "CompanyCode"
            case createdTime = "CreatedTime"
            case displayName = "DisplayName"
            case fleetArn = "FleetArn"
            case fleetName = "FleetName"
            case fleetStatus = "FleetStatus"
            case lastUpdatedTime = "LastUpdatedTime"
            case tags = "Tags"
        }
    }

    public struct ListDevicesRequest: AWSEncodableShape {
        /// The ARN of the fleet.
        public let fleetArn: String
        /// The maximum number of results to be included in the next page.
        public let maxResults: Int?
        /// The pagination token used to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
        public let nextToken: String?

        public init(fleetArn: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.fleetArn = fleetArn
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 4096)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\w\\-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case fleetArn = "FleetArn"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListDevicesResponse: AWSDecodableShape {
        /// Information about the devices.
        public let devices: [DeviceSummary]?
        /// The pagination token used to retrieve the next page of results for this operation. If there are no more pages, this value is null.
        public let nextToken: String?

        public init(devices: [DeviceSummary]? = nil, nextToken: String? = nil) {
            self.devices = devices
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case devices = "Devices"
            case nextToken = "NextToken"
        }
    }

    public struct ListDomainsRequest: AWSEncodableShape {
        /// The ARN of the fleet.
        public let fleetArn: String
        /// The maximum number of results to be included in the next page.
        public let maxResults: Int?
        /// The pagination token used to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
        public let nextToken: String?

        public init(fleetArn: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.fleetArn = fleetArn
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 4096)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\w\\-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case fleetArn = "FleetArn"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListDomainsResponse: AWSDecodableShape {
        /// Information about the domains.
        public let domains: [DomainSummary]?
        /// The pagination token used to retrieve the next page of results for this operation. If there are no more pages, this value is null.
        public let nextToken: String?

        public init(domains: [DomainSummary]? = nil, nextToken: String? = nil) {
            self.domains = domains
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case domains = "Domains"
            case nextToken = "NextToken"
        }
    }

    public struct ListFleetsRequest: AWSEncodableShape {
        /// The maximum number of results to be included in the next page.
        public let maxResults: Int?
        /// The pagination token used to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 4096)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\w\\-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListFleetsResponse: AWSDecodableShape {
        /// The summary list of the fleets.
        public let fleetSummaryList: [FleetSummary]?
        /// The pagination token used to retrieve the next page of results for this operation. If there are no more pages, this value is null.
        public let nextToken: String?

        public init(fleetSummaryList: [FleetSummary]? = nil, nextToken: String? = nil) {
            self.fleetSummaryList = fleetSummaryList
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case fleetSummaryList = "FleetSummaryList"
            case nextToken = "NextToken"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri("ResourceArn"))
        ]

        /// The Amazon Resource Name (ARN) of the fleet.
        public let resourceArn: String

        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 20)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// The tags attached to the resource. A tag is a key-value pair.
        public let tags: [String: String]?

        public init(tags: [String: String]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct ListWebsiteAuthorizationProvidersRequest: AWSEncodableShape {
        /// The ARN of the fleet.
        public let fleetArn: String
        /// The maximum number of results to be included in the next page.
        public let maxResults: Int?
        /// The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
        public let nextToken: String?

        public init(fleetArn: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.fleetArn = fleetArn
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 4096)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\w\\-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case fleetArn = "FleetArn"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListWebsiteAuthorizationProvidersResponse: AWSDecodableShape {
        /// The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
        public let nextToken: String?
        /// The website authorization providers.
        public let websiteAuthorizationProviders: [WebsiteAuthorizationProviderSummary]?

        public init(nextToken: String? = nil, websiteAuthorizationProviders: [WebsiteAuthorizationProviderSummary]? = nil) {
            self.nextToken = nextToken
            self.websiteAuthorizationProviders = websiteAuthorizationProviders
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case websiteAuthorizationProviders = "WebsiteAuthorizationProviders"
        }
    }

    public struct ListWebsiteCertificateAuthoritiesRequest: AWSEncodableShape {
        /// The ARN of the fleet.
        public let fleetArn: String
        /// The maximum number of results to be included in the next page.
        public let maxResults: Int?
        /// The pagination token used to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
        public let nextToken: String?

        public init(fleetArn: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.fleetArn = fleetArn
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 4096)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\w\\-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case fleetArn = "FleetArn"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListWebsiteCertificateAuthoritiesResponse: AWSDecodableShape {
        /// The pagination token used to retrieve the next page of results for this operation. If there are no more pages, this value is null.
        public let nextToken: String?
        /// Information about the certificates.
        public let websiteCertificateAuthorities: [WebsiteCaSummary]?

        public init(nextToken: String? = nil, websiteCertificateAuthorities: [WebsiteCaSummary]? = nil) {
            self.nextToken = nextToken
            self.websiteCertificateAuthorities = websiteCertificateAuthorities
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case websiteCertificateAuthorities = "WebsiteCertificateAuthorities"
        }
    }

    public struct RestoreDomainAccessRequest: AWSEncodableShape {
        /// The name of the domain.
        public let domainName: String
        /// The ARN of the fleet.
        public let fleetArn: String

        public init(domainName: String, fleetArn: String) {
            self.domainName = domainName
            self.fleetArn = fleetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.domainName, name: "domainName", parent: name, max: 253)
            try self.validate(self.domainName, name: "domainName", parent: name, min: 1)
            try self.validate(self.domainName, name: "domainName", parent: name, pattern: "^[a-zA-Z0-9]?((?!-)([A-Za-z0-9-]*[A-Za-z0-9])\\.)+[a-zA-Z0-9]+$")
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case domainName = "DomainName"
            case fleetArn = "FleetArn"
        }
    }

    public struct RestoreDomainAccessResponse: AWSDecodableShape {
        public init() {}
    }

    public struct RevokeDomainAccessRequest: AWSEncodableShape {
        /// The name of the domain.
        public let domainName: String
        /// The ARN of the fleet.
        public let fleetArn: String

        public init(domainName: String, fleetArn: String) {
            self.domainName = domainName
            self.fleetArn = fleetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.domainName, name: "domainName", parent: name, max: 253)
            try self.validate(self.domainName, name: "domainName", parent: name, min: 1)
            try self.validate(self.domainName, name: "domainName", parent: name, pattern: "^[a-zA-Z0-9]?((?!-)([A-Za-z0-9-]*[A-Za-z0-9])\\.)+[a-zA-Z0-9]+$")
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case domainName = "DomainName"
            case fleetArn = "FleetArn"
        }
    }

    public struct RevokeDomainAccessResponse: AWSDecodableShape {
        public init() {}
    }

    public struct SignOutUserRequest: AWSEncodableShape {
        /// The ARN of the fleet.
        public let fleetArn: String
        /// The name of the user.
        public let username: String

        public init(fleetArn: String, username: String) {
            self.fleetArn = fleetArn
            self.username = username
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
            try self.validate(self.username, name: "username", parent: name, max: 256)
            try self.validate(self.username, name: "username", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case fleetArn = "FleetArn"
            case username = "Username"
        }
    }

    public struct SignOutUserResponse: AWSDecodableShape {
        public init() {}
    }

    public struct TagResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri("ResourceArn"))
        ]

        /// The Amazon Resource Name (ARN) of the fleet.
        public let resourceArn: String
        /// The tags to add to the resource. A tag is a key-value pair.
        public let tags: [String: String]

        public init(resourceArn: String, tags: [String: String]) {
            self.resourceArn = resourceArn
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 20)
            try self.tags.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri("ResourceArn")),
            AWSMemberEncoding(label: "tagKeys", location: .querystring("tagKeys"))
        ]

        /// The Amazon Resource Name (ARN) of the fleet.
        public let resourceArn: String
        /// The list of tag keys to remove from the resource.
        public let tagKeys: [String]

        public init(resourceArn: String, tagKeys: [String]) {
            self.resourceArn = resourceArn
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 20)
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
                try validate($0, name: "tagKeys[]", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
            }
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, max: 50)
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateAuditStreamConfigurationRequest: AWSEncodableShape {
        /// The ARN of the Amazon Kinesis data stream that receives the audit events.
        public let auditStreamArn: String?
        /// The ARN of the fleet.
        public let fleetArn: String

        public init(auditStreamArn: String? = nil, fleetArn: String) {
            self.auditStreamArn = auditStreamArn
            self.fleetArn = fleetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.auditStreamArn, name: "auditStreamArn", parent: name, pattern: "^arn:aws:kinesis:.+:[0-9]{12}:stream/AmazonWorkLink-.*$")
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case auditStreamArn = "AuditStreamArn"
            case fleetArn = "FleetArn"
        }
    }

    public struct UpdateAuditStreamConfigurationResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateCompanyNetworkConfigurationRequest: AWSEncodableShape {
        /// The ARN of the fleet.
        public let fleetArn: String
        /// The security groups associated with access to the provided subnets.
        public let securityGroupIds: [String]
        /// The subnets used for X-ENI connections from Amazon WorkLink rendering containers.
        public let subnetIds: [String]
        /// The VPC with connectivity to associated websites.
        public let vpcId: String

        public init(fleetArn: String, securityGroupIds: [String], subnetIds: [String], vpcId: String) {
            self.fleetArn = fleetArn
            self.securityGroupIds = securityGroupIds
            self.subnetIds = subnetIds
            self.vpcId = vpcId
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
            try self.securityGroupIds.forEach {
                try validate($0, name: "securityGroupIds[]", parent: name, pattern: "^sg-([0-9a-f]{8}|[0-9a-f]{17})$")
            }
            try self.validate(self.securityGroupIds, name: "securityGroupIds", parent: name, max: 5)
            try self.subnetIds.forEach {
                try validate($0, name: "subnetIds[]", parent: name, pattern: "^subnet-([0-9a-f]{8}|[0-9a-f]{17})$")
            }
            try self.validate(self.vpcId, name: "vpcId", parent: name, pattern: "^vpc-([0-9a-f]{8}|[0-9a-f]{17})$")
        }

        private enum CodingKeys: String, CodingKey {
            case fleetArn = "FleetArn"
            case securityGroupIds = "SecurityGroupIds"
            case subnetIds = "SubnetIds"
            case vpcId = "VpcId"
        }
    }

    public struct UpdateCompanyNetworkConfigurationResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateDevicePolicyConfigurationRequest: AWSEncodableShape {
        /// The certificate chain, including intermediate certificates and the root certificate authority certificate used to issue device certificates.
        public let deviceCaCertificate: String?
        /// The ARN of the fleet.
        public let fleetArn: String

        public init(deviceCaCertificate: String? = nil, fleetArn: String) {
            self.deviceCaCertificate = deviceCaCertificate
            self.fleetArn = fleetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.deviceCaCertificate, name: "deviceCaCertificate", parent: name, max: 32768)
            try self.validate(self.deviceCaCertificate, name: "deviceCaCertificate", parent: name, min: 1)
            try self.validate(self.deviceCaCertificate, name: "deviceCaCertificate", parent: name, pattern: "^(-{5}BEGIN CERTIFICATE-{5}\\u000D?\\u000A([A-Za-z0-9/+]{64}\\u000D?\\u000A)*[A-Za-z0-9/+]{1,64}={0,2}\\u000D?\\u000A-{5}END CERTIFICATE-{5}\\u000D?\\u000A)*-{5}BEGIN CERTIFICATE-{5}\\u000D?\\u000A([A-Za-z0-9/+]{64}\\u000D?\\u000A)*[A-Za-z0-9/+]{1,64}={0,2}\\u000D?\\u000A-{5}END CERTIFICATE-{5}(\\u000D?\\u000A)?$")
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case deviceCaCertificate = "DeviceCaCertificate"
            case fleetArn = "FleetArn"
        }
    }

    public struct UpdateDevicePolicyConfigurationResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateDomainMetadataRequest: AWSEncodableShape {
        /// The name to display.
        public let displayName: String?
        /// The name of the domain.
        public let domainName: String
        /// The ARN of the fleet.
        public let fleetArn: String

        public init(displayName: String? = nil, domainName: String, fleetArn: String) {
            self.displayName = displayName
            self.domainName = domainName
            self.fleetArn = fleetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.displayName, name: "displayName", parent: name, max: 100)
            try self.validate(self.domainName, name: "domainName", parent: name, max: 253)
            try self.validate(self.domainName, name: "domainName", parent: name, min: 1)
            try self.validate(self.domainName, name: "domainName", parent: name, pattern: "^[a-zA-Z0-9]?((?!-)([A-Za-z0-9-]*[A-Za-z0-9])\\.)+[a-zA-Z0-9]+$")
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case displayName = "DisplayName"
            case domainName = "DomainName"
            case fleetArn = "FleetArn"
        }
    }

    public struct UpdateDomainMetadataResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateFleetMetadataRequest: AWSEncodableShape {
        /// The fleet name to display. The existing DisplayName is unset if null is passed.
        public let displayName: String?
        /// The ARN of the fleet.
        public let fleetArn: String
        /// The option to optimize for better performance by routing traffic through the closest AWS Region to users, which may be outside of your home Region.
        public let optimizeForEndUserLocation: Bool?

        public init(displayName: String? = nil, fleetArn: String, optimizeForEndUserLocation: Bool? = nil) {
            self.displayName = displayName
            self.fleetArn = fleetArn
            self.optimizeForEndUserLocation = optimizeForEndUserLocation
        }

        public func validate(name: String) throws {
            try self.validate(self.displayName, name: "displayName", parent: name, max: 100)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case displayName = "DisplayName"
            case fleetArn = "FleetArn"
            case optimizeForEndUserLocation = "OptimizeForEndUserLocation"
        }
    }

    public struct UpdateFleetMetadataResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateIdentityProviderConfigurationRequest: AWSEncodableShape {
        /// The ARN of the fleet.
        public let fleetArn: String
        /// The SAML metadata document provided by the customer’s identity provider. The existing IdentityProviderSamlMetadata is unset if null is passed.
        public let identityProviderSamlMetadata: String?
        /// The type of identity provider.
        public let identityProviderType: IdentityProviderType

        public init(fleetArn: String, identityProviderSamlMetadata: String? = nil, identityProviderType: IdentityProviderType) {
            self.fleetArn = fleetArn
            self.identityProviderSamlMetadata = identityProviderSamlMetadata
            self.identityProviderType = identityProviderType
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, max: 2048)
            try self.validate(self.fleetArn, name: "fleetArn", parent: name, min: 20)
            try self.validate(self.identityProviderSamlMetadata, name: "identityProviderSamlMetadata", parent: name, max: 204_800)
            try self.validate(self.identityProviderSamlMetadata, name: "identityProviderSamlMetadata", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case fleetArn = "FleetArn"
            case identityProviderSamlMetadata = "IdentityProviderSamlMetadata"
            case identityProviderType = "IdentityProviderType"
        }
    }

    public struct UpdateIdentityProviderConfigurationResponse: AWSDecodableShape {
        public init() {}
    }

    public struct WebsiteAuthorizationProviderSummary: AWSDecodableShape {
        /// A unique identifier for the authorization provider.
        public let authorizationProviderId: String?
        /// The authorization provider type.
        public let authorizationProviderType: AuthorizationProviderType
        /// The time of creation.
        public let createdTime: Date?
        /// The domain name of the authorization provider. This applies only to SAML-based authorization providers.
        public let domainName: String?

        public init(authorizationProviderId: String? = nil, authorizationProviderType: AuthorizationProviderType, createdTime: Date? = nil, domainName: String? = nil) {
            self.authorizationProviderId = authorizationProviderId
            self.authorizationProviderType = authorizationProviderType
            self.createdTime = createdTime
            self.domainName = domainName
        }

        private enum CodingKeys: String, CodingKey {
            case authorizationProviderId = "AuthorizationProviderId"
            case authorizationProviderType = "AuthorizationProviderType"
            case createdTime = "CreatedTime"
            case domainName = "DomainName"
        }
    }

    public struct WebsiteCaSummary: AWSDecodableShape {
        /// The time when the CA was added.
        public let createdTime: Date?
        /// The name to display.
        public let displayName: String?
        /// A unique identifier for the CA.
        public let websiteCaId: String?

        public init(createdTime: Date? = nil, displayName: String? = nil, websiteCaId: String? = nil) {
            self.createdTime = createdTime
            self.displayName = displayName
            self.websiteCaId = websiteCaId
        }

        private enum CodingKeys: String, CodingKey {
            case createdTime = "CreatedTime"
            case displayName = "DisplayName"
            case websiteCaId = "WebsiteCaId"
        }
    }
}

// MARK: - Errors

/// Error enum for WorkLink
public struct WorkLinkErrorType: AWSErrorType {
    enum Code: String {
        case internalServerErrorException = "InternalServerErrorException"
        case invalidRequestException = "InvalidRequestException"
        case resourceAlreadyExistsException = "ResourceAlreadyExistsException"
        case resourceNotFoundException = "ResourceNotFoundException"
        case tooManyRequestsException = "TooManyRequestsException"
        case unauthorizedException = "UnauthorizedException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize WorkLink
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// The service is temporarily unavailable.
    public static var internalServerErrorException: Self { .init(.internalServerErrorException) }
    /// The request is not valid.
    public static var invalidRequestException: Self { .init(.invalidRequestException) }
    /// The resource already exists.
    public static var resourceAlreadyExistsException: Self { .init(.resourceAlreadyExistsException) }
    /// The requested resource was not found.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
    /// The number of requests exceeds the limit.
    public static var tooManyRequestsException: Self { .init(.tooManyRequestsException) }
    /// You are not authorized to perform this action.
    public static var unauthorizedException: Self { .init(.unauthorizedException) }
}

extension WorkLinkErrorType: Equatable {
    public static func == (lhs: WorkLinkErrorType, rhs: WorkLinkErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension WorkLinkErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
